package com.hliushi.learn.scheduler;

import org.junit.Test;

import java.time.LocalDateTime;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;

/**
 * @author llhuang10
 * @date 2021/8/16 21:20
 */
public class SimpleDemo03 {

    public static void main(String[] args) {

        ScheduledExecutorService service = Executors.newScheduledThreadPool(10);

        service.scheduleAtFixedRate(() -> {
                    // todo
                    System.out.printf("time: %s, to do222, ...\n", LocalDateTime.now());
                }
                , 1, 3, TimeUnit.MILLISECONDS);

    }


    /**
     * getName和getCanonicalName区别在哪
     */
    @Test
    public void testPrintClassName() {
        System.out.println(SimpleDemo03.class.getCanonicalName());


        System.out.println(SimpleDemo03.class.getName());

        System.out.println(SimpleDemo03.class.getSimpleName());
    }
}
